/*
 * @Author: your name
 * @Date: 2021-09-01 11:46:22
 * @LastEditTime: 2021-09-01 16:45:01
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\5-javascript\day08\6-正则表达式属性.js
 */

var pattern = /abc/img
console.log(pattern.global); //true
console.log(pattern.ignoreCase); //true
console.log(pattern.multiline); //true
console.log(pattern.lastIndex); //0
console.log(pattern.source); //abc
console.log(pattern.flags); //gim

//replace 替换文本内容  源文本不受影响
var text = "javascript";
text.replace(/javascript/gi, "JavaScript");
console.log(text); //javascript
console.log(text.replace(/javascript/gi, "JavaScript")); //JavaScript